﻿using Microsoft.AspNetCore.Mvc;
using WorkV5APIS.Common;
using WorkV5APIS.Models;

namespace WorkV5APIS.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class SystemController : Controller
    {

        #region 菜单


        [Route("GetMenus")]
        public JsonResult GetMenus()
        {
            using (var db = linkDB.CreateDB())
                try
                {

                    var menus = db.Queryable<S_Menu>().Where(s => s.isDeleted == 0).ToList();

                    return Json(new { data = menus, code = 200, msg = "" });

                }
                catch (Exception ex)
                {
                    return Json(new { code = 204, msg = ex.Message });
                }

        }

        #endregion


    }
}
